import type React from "react"
import "./globals.css"
import { Inter } from "next/font/google"
import { Navigation } from "@/components/navigation"
import { Toaster } from "@/components/ui/toaster"
import { AuthProvider } from "@/contexts/auth-context"
import { RouteGuard } from "@/components/route-guard"
import { LanguageProvider } from "@/lib/i18n"

const inter = Inter({ subsets: ["latin"] })

export const metadata = {
  title: "HackPlay - 竞赛开黑平台",
  description: "最像开黑游戏的比赛平台",
  generator: 'v0.dev'
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="zh">
      <body className={`${inter.className} bg-slate-950 text-white min-h-screen`}>
        <LanguageProvider>
          <AuthProvider>
            <RouteGuard>
              <div className="relative">
                {/* 背景粒子效果 */}
                <div className="fixed inset-0 overflow-hidden pointer-events-none">
                  <div className="absolute inset-0 bg-gradient-to-br from-blue-900/20 via-purple-900/20 to-pink-900/20" />
                  <div className="stars absolute inset-0" />
                </div>

                <Navigation />
                <main className="relative z-10">{children}</main>
                <Toaster />
              </div>
            </RouteGuard>
          </AuthProvider>
        </LanguageProvider>
      </body>
    </html>
  )
}
